Page({
  data: {
    user:[],
    butuocya:[]
  },
  
  onLoad: function (options) {
  //获取收货地址 省略
    var value = wx.getStorageSync('user')
    this.setData({user:value})
  },
  dianji:function () {
    var that = this;
        console.log("微信授权登录被点击");
        wx.getUserProfile({
          desc: "完善用户资料",
          success: (res) => {
            console.log("授权成功");
            that.data.user.push(res.userInfo)
          },
          fail: (res) => {
            console.log("授权失败");
          },
        });
        console.log(this.data.user);
  },
  dizhi:function() {
    if(this.data.butuocya.length>0){
      wx.navigateTo({
        url: '../detail-address/index',
      })
    }else{
      wx.navigateTo({
        url: '../detail-receiving/index',
      })
    }
  },
  onShow(){
    let bucuo= wx.getStorageSync('key')
    this.setData({butuocya:bucuo})
  }
  

 })